from api import client
from common.read_yaml import get_yaml_filepath
from common.route import *
from common.read_config import test_token

data = get_yaml_filepath(Environ='data.yaml')  # 读取config下的data数据
class MemberControllerApi(client.HttpClient):
    def __init__(self, token):
        super().__init__()
        self.host = data['admin_host']
        self.token = token
    """登录接口封装"""
    def login(self,username,phoneValid):
        """

        :param username: 手机号
        :param phoneValid: 验证码，固定222222
        :return: 请求返回值
        """
        url = login_data['url']
        method = login_data['method']
        body = {"zip": "+86", "username": username,
                "phoneValid": phoneValid, "pushRegister": "", "source": "", "monitor_name": "",
                "openId": "", "fromApp": False}
        url = self.get_full_url(url)
        return self.send(url, method=method, body=body)




